package com.lzx.adx.report.enums;

public enum ChannelAdvertiserMapping {
    hw_elm("hw","https://alsc-ug-monitor-callback.alibaba.com/streamMonitor/click?request_id=__REQUEST_ID__&traffic_source=__TRAFFIC_SOURCE__&imei=__IMEI__&imei_md5=__IMEI_MD5__&oaid=__OAID__&oaid_md5=__OAID_MD5__&idfa=__IDFA__&idfa_md5=__IDFA_MD5__&ip=__IP__&ua=__UA__&model=__MODEL__&os=__OS__&mac=__MAC__&mac_md5=__MAC_MD5__&mac1_md5=__MAC1_MD5__&caid=__CAID__&callback_url=__CALLBACK_URL__&mts=__MTS__&medium_source=-1&delivery_type=10&ascribe_type=3&demander_type=5&biz_type=2&task_id=CDBE0561FB2DE172&propagator_id=70DC652563969A8FE89A3874C2AECBE2&propagation_site=2033F61D8C01EF3F&task_type=1A2","华为-饿了么");

    /**
     * 渠道Code
     */
    private String code;

    /**
     * 广告主 接口URL
     */
    private String adverUrl;


    private String msg;


    ChannelAdvertiserMapping(String code, String adverUrl, String msg) {
        this.code = code;
        this.adverUrl = adverUrl;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public String getAdverUrl() {
        return adverUrl;
    }

    public String getMsg() {
        return msg;
    }

    public static String getAdverUrlByChannelCode(String code){
        ChannelAdvertiserMapping[] values = ChannelAdvertiserMapping.values();
        for (ChannelAdvertiserMapping advertiserMapping:values){
            if(code.contains(advertiserMapping.getCode())){
                return advertiserMapping.getAdverUrl();
            }
        }
        return null;
    }
}
